package controller;

import java.io.File;

import observerNotification.ChangingStateObserverNotification;
import observerNotification.ObserverNotification;


/**
 * Sets specific control methods for the <b>connected</b> state (Allow actions or not)
 * 
 * <p>
 * <ul>
 * <li>Project: 	ChatSystemG3</li>
 * <li>Called by: 	controller.*</li>
 * </ul>
 * </p>
 * 
 * @author COMBES Nicolas - LECHANTRE Arnaud
 * @see State
 */
public class ConnectedState extends State{

	@Override
	public ObserverNotification performDisconnect() {
		return new ChangingStateObserverNotification (null, ChangingStateObserverNotification.EnumState.DISCONNECTED);
	}
	
	@Override
	public Boolean openConversation(Object[] userList) {
		return (userList.length!=0);
	}
	
	@Override
	public Boolean sendMessage(int convId, String message) {
		return message!=null;
	}
	
	@Override
	public Boolean sendFile(File file) {
		return true;
	}  
	
	@Override
	public Boolean answerFileRequest(int convId, boolean accept, String filename, File donwladLink) {
		return true; 
	}
	
	@Override
	public int shareNewFile() {
		return 1;
	}
	
}
